package com.xtwy.repository;

import com.xtwy.entity.Poem;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;

/**
 * dao层
 */
public interface PoemRepository extends ElasticsearchRepository<Poem,Long> {
    /**
     * 模糊查找标题或内容
     * @param title
     * @param content
     * @param pageable
     * @return
     */
    Page<Poem> findByTitleLikeOrContentLike(String title, String content, Pageable pageable);

    /**
     *  查询内容标题
     * @param content
     * @param pageable
     * @return
     */
    Page<Poem> findByContentLike(String content, Pageable pageable);
}
